@using BlazorDatasheet.Edit
@using BlazorDatasheet.Core.Edit
@inherits BaseEditor
<input type="number"
       @bind="CurrentValue"
       style="width: 100%; height: 100%"
       @ref="InputRef"
       @bind:event="oninput"/>

@code {

    public override void BeginEdit(EditEntryMode entryMode, string? editValue, string key)
    {
        try
        {
            double.TryParse(editValue?.ToString(), out var cellValue);
            CurrentValue = editValue ?? string.Empty;
            if (entryMode == EditEntryMode.Key && char.IsNumber(key[0]))
                CurrentValue = key[0].ToString();
        }
        catch (Exception e)
        {
            CurrentValue = "0";
        }
    }

}